import { useLocale } from '@/composables/useLocale';
import { getEnvConfig } from '@/utils/common.ts';
import { FAQ_DOCS_LINK } from '@/config/docs.ts';

const { t } = useLocale();

export const NAVS = [
  {
    id: 'home',
    label: t('header.home'),
    href: '/',
    children: [],
  },
  {
    id: 'download',
    label: t('header.download'),
    children: [
      {
        label: t('header.communityReleases'),
        href: '/download',
        tag: 'new',
        tagExpire: '2025-11-01',
      },
      {
        label: t('header.marketplace'),
        href: '/marketplace',
      },
    ],
  },
  {
    id: 'development',
    label: t('header.development'),
    children: [
      {
        label: t('header.sig'),
        href: '/sig',
        tag: 'new',
        tagExpire: '2025-08-17',
      },
      {
        label: 'CLA签署',
        href: 'https://clasign.osinfra.cn/sign/gitee_openubmc-1732941016829438030?lang=zh',
        jumpOut: true,
      },
      {
        label: t('header.contributionGuide'),
        href: '/contribution',
      },
      {
        label: t('header.releasePlatform'),
        href: getEnvConfig('VITE_RELEASE_PLATFORM_URL'),
        checkPermKey: 'meeting',
        jumpOut: true,
      },
    ],
  },
  {
    id: 'docs',
    label: t('header.docs'),
    children: [
      {
        label: t('header.docsCenter'),
        href: '/docs',
      },
    ],
  },
  {
    id: 'learn',
    label: t('header.learn'),
    keys: ['course'],
    children: [
      {
        label: t('header.course'),
        href: '/course',
        tag: 'new',
        tagExpire: '2025-11-01',
      },
    ],
  },
  {
    id: 'support',
    label: t('header.support'),
    keys: ['cve', 'vulnerability-management'],
    children: [
      {
        label: t('header.security'),
        href: '/security-advisories',
      },
    ],
  },
  {
    id: 'community',
    label: t('header.community'),
    children: [
      {
        label: t('header.orgStructure'),
        href: '/organizations',
      },
      {
        label: t('header.policyRules'),
        href: '/charter',
      },
      {
        label: t('header.datastat'),
        href: getEnvConfig('VITE_DATASTAT_ORIGIN'),
        tag: 'new',
        tagExpire: '2025-10-25',
      },
      {
        label: t('header.forum'),
        href: getEnvConfig('VITE_FORUM_URL'),
      },
      {
        label: t('header.maillist'),
        href: '/maillist',
      },
    ],
  },
  {
    id: 'trends',
    label: t('header.trends'),
    children: [
      {
        label: t('header.blogs'),
        href: '/blogs',
      },
      {
        label: t('header.news'),
        href: '/news',
      },
    ],
  },
];
